Skip to content

MEN-9322 + partial MEN-9001 - deployment creation things - #2144

Open
mzedel wants to merge 20 commits into
mendersoftware:mainfrom
mzedel:men-9322-9001
Open

MEN-9322 + partial MEN-9001 - deployment creation things#2144
mzedel wants to merge 20 commits into
mendersoftware:mainfrom
mzedel:men-9322-9001

Conversation

@mzedel

@mzedel mzedel commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

No description provided.

mzedel added 14 commits August 7, 2026 13:28
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
… utils

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…d design

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…se definitions

- also mode conversion + basic phase management actions

Ticket: MEN-9001
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Ticket: MEN-9001
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…ions

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…ions

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
- extracted phase payload assembly to reduce cognitive complexity

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…lying component

- also added type infos

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
@mzedel mzedel added the WIP label Aug 7, 2026
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.79437% with 18 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...oyments/deployment-wizard/phases/UniformPhases.tsx 76.31% 18 Missing ⚠️

📢 Thoughts on this report? Let us know!

mzedel added 6 commits August 10, 2026 13:34
- also adjusted docs links appearance & targets
- let date time picker rely on the commonly used format to increase alignment

Ticket: MEN-9322

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
- this handles rollout pattern, pause settings & device limit expansion explicitly

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…rrors

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Ticket: MEN-9322

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
…ng & design

Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
Signed-off-by: Manuel Zedel <manuel.zedel@northern.tech>
@mzedel mzedel removed the WIP label Aug 10, 2026
@mzedel
mzedel requested a review from mineralsfree August 10, 2026 11:38

@mineralsfree mineralsfree left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few things I noticed, some of them worth fixing before merging IMO

Comment on lines +306 to +309
const { hasError, hasWarning } = messages.reduce(
(accu, { severity }) => ({ hasError: accu.hasError || severity === 'error', hasWarning: accu.hasWarning || severity === 'warning' }),
{ hasError: false, hasWarning: false }
);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe

const hasError = messages.some(({ severity }) => severity === 'error');
const hasWarning = messages.some(({ severity }) => severity === 'warning');

Comment on lines +33 to +37
const percentage = phases.reduce((accu, phase, index, source) => {
if (index === source.length - 1) {
return accu;
}
return phase.batch_size ? accu - phase.batch_size : accu;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

consider

  phases.slice(0, -1).reduce((accu, { batch_size_devices = 0 }) => accu + batch_size_devices, 100);

return `${toFixedWithoutRounding(number)}K`;
}
return count.toLocaleString();
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we could use something like

const deviceCountFormatter = new Intl.NumberFormat('en-US', { notation: 'compact', roundingMode: 'trunc' });
export const formatDeviceCount = (count: number): string => (Number.isFinite(count) && count >= 0 ? deviceCountFormatter.format(count) : '0');

instead?

<TableCell>
{!isLast && phases.length > 1 ? (
<div className="flexbox">
<IconButton onClick={() => repeatPhase(index)} title="Repeat phase">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe disable/remove when phase > 50%? Replacing all consequent phases might be not what user expects

it('prefers the smallest whole-number unit', () => {
expect(parseInterval('86400s')).toEqual({ delay: 1, delayUnit: delayUnits.days });
expect(parseInterval('7200s')).toEqual({ delay: 2, delayUnit: delayUnits.hours });
expect(parseInterval('5400s')).toEqual({ delay: 30, delayUnit: delayUnits.minutes });

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5400s is more than 30 minutes. 😄 parseInterval has incorrect implementation

isPercentageMode={isPercentageMode}
hasError={hasError}
max={max}
disabled={isLast && deviceCount >= 1}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should not allow editing the last phase even if deviceCount == 0

const phaseObject = {
'Phase start time': <Time value={startTime} />,
'Batch size': `${batchSize}%${deviceCountText}`
'Batch size': isPercentageMode ? `${batchSize}%${deviceCountText}` : batchSize

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe : ${batchSize} ${pluralize('device', deviceCount)}

const prefix = 'Uniform: ';
let phasesDescription = '';
if (isPercentageMode) {
phasesDescription = `${batch_size}% per phase, ${delay}${delayUnit || delayDefaults.delayUnit} intervals`;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

${delay} ${delayUnit || delayDefaults.delayUnit}
maybe add space

<ErrorOutlineIcon fontSize="small" style={{ marginRight: 4, top: 4, color: 'rgb(171, 16, 0)' }} />
<InfoText>
<FormHelperText className="flexbox align-items-center">
<ErrorOutlineIcon className=" margin-right-x-small" fontSize="small" color="error" />

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
<ErrorOutlineIcon className=" margin-right-x-small" fontSize="small" color="error" />
<ErrorOutlineIcon className="margin-right-x-small" fontSize="small" color="error" />

return accu;
}
return phase.batch_size ? accu - phase.batch_size : accu;
}, 100);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe phaseLimits.fullBatchPercentage instead of 100

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants